package com.gopay.bis.service.bank.query.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.gopay.bis.service.bank.query.BisBankWhiteListMerchantsService;
import com.gopay.common.order.dao.CommonQueryDAO;

@Service("bisBankWhiteListMerchantsService")
public class BisBankWhiteListMerchantsServiceImpl implements BisBankWhiteListMerchantsService {
    @Resource(name = "commonQueryDAO")
    private CommonQueryDAO commonQueryDAO;

    @Override
    public boolean isWhiteListMerchant(String merId) {
        String sql = "select * from BIS_BANK_WHITE_LIST_MERCHANTS where ENABLE='1' and MER_ID=:merId";
        
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("merId", merId);
        List<Object[]> list = commonQueryDAO.findBySql(sql.toString(), map);

        if (list != null && list.size() > 0) {
            return true;
        } else {
            return false;
        }
    }

}
